        <br/>
        <select id="orders" class="form-control" onChange="test.reload($('#orders').val())">
          <option value="00120170529174214000039">给本人投保法定受益人</option>
          <option value="00120170524235549000023">非本人投保指定受益人</option>
        </select>
        <br/>
        <textarea id="order" class="form-control" style="height:300px"></textarea>
        <br/>
        <textarea id="script" class="form-control" style="height:300px"></textarea>
    	<br/>
        <input type="button" class="btn btn-primary btn-lg" value="测试 >>>>" onClick="test.insure()"/>
        <input type="button" class="btn btn-primary btn-lg" value="重置 >>>>" onClick="test.reset()"/>
        <br/><br/>
        <pre id="result"></pre>
<script>
  var test = {};

  test.reset = function() {
    common.req("ware/reset.do", {script:$("#script").val(), order:test.order}, function(r) {
      alert("success");
    });
  }

  test.insure = function() {
    common.req("ware/test.json", {channel:"idb", type:1, opt:"insure", script:$("#script").val(), content:test.order}, function(r) {
      $("#result").html(JSON.stringify(r));
      $("#result").css("color", "#000");
    }, function(reason) {
      $("#result").html(reason);
      $("#result").css("color", "#F00");
    });
  }

  test.reload = function(orderId) {
    common.req("order/view.json", {orderId:orderId}, function(r) {
      test.order = r;
      $("#order").val(JSON.stringify(r));
    });
  }

  $(document).ready( function() {
    test.reload($("#orders").val());
  });
</script>

